import path from 'path';
import { createRouter,createWebHistory } from 'vue-router'

const routes = [
    {
        path: '/',
        name: 'Home',
        component: () => import('@/views/Home.vue'),
        //useFrame 如果为true 代表不是全屏展示 
        meta: { title: '首页', show: true, icon:'HomeFilled',useFrame:true }
    },
    {
        path: '/movecar',
        name: 'movecar',
        component: () => import('@/views/moveCar/MoveCars.vue'),
        //useFrame 如果为true 代表不是全屏展示 
        meta: { title: '移动端首页', show: false, icon: 'HomeFilled', useFrame: false }
    },
    {
        path: '/category',
        component: () => import('@/views/category/Index.vue'),
        meta: { title: '分类管理', show: true, icon: 'Grid', },
        children: [
            {
                path: '/category/add',
                name: 'category-add',
                component: () => import('@/views/category/Add.vue'),
                meta: { title: '添加分类', show: true, icon: 'Plus' }
            },
            {
                path: '/category/eidt',
                name: 'category-edit',
                component: () => import('@/views/category/Edit.vue'),
                meta: { title: '修改分类' ,show: true, icon: 'Edit' }
            },
            {
                path: '/category/list',
                name: 'category-list',
                component: () => import('@/views/category/List.vue'),
                meta: { title: '分类列表', show: true, icon: 'List' }
            },
            
        ]
    },
    {
        path: '/product',
        component: () => import('@/views/product/Index.vue'),
        meta: { title: '商品管理', show: true, icon: 'Briefcase'},
        children: [
            {
                path: '/product/add',
                name: 'product-add',
                component: () => import('@/views/product/Add.vue'),
                meta: { title: '添加商品', show: true, icon: 'Plus' }
            },
            {
                path: '/product/eidt',
                name: 'product-edit',
                component: () => import('@/views/product/Edit.vue'),
                meta: { title: '修改商品', show: true, icon: 'Edit' }
            },
            {
                path: '/product/list',
                name: 'product-list',
                component: () => import('@/views/product/List.vue'),
                meta: { title: '商品列表', show: true, icon: 'List' }
            },

        ]
    }
]

const router=createRouter({
    history: createWebHistory(),
    routes,
})
export default router;
